#include <stdio.h>
#include <unistd.h>
#include <sys/wait.h>
#include <stdlib.h>

int main(){
      pid_t pid = fork();
      if(pid < 0){
        perror("fork");
         return 0;
                    
      }else if(pid == 0){
      //child
        printf("i am child process");
        sleep(5);            
      }else{ 
        //father 
        waitpid(pid, NULL, WNOHANG);              
        while(1){
          sleep(1);
        }
      }
      return 0;
}

      
